package com.af.system.api.page;

import java.io.Serializable;

/**
 * @author : zhenyun.su
 * @since : 2020/7/14
 * @Commit: 请求分页,可单独使用，也可以被DTO继承使用
 *  index:  分页索引
 *  size: 每页大小
 */

public class AfPage implements Serializable {
    private Integer index;
    private Integer size;

    public AfPage() {
    }

    public AfPage(Integer index, Integer size) {
        this.index = index;
        this.size = size;
    }

    public static AfPage of(Integer pageIndex, Integer pageSize){
        return new AfPage(pageIndex, pageSize);
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    @Override
    public String toString() {
        return "Page{" +
                "index=" + index +
                ", size=" + size +
                '}';
    }
}
